<%@ page language="java" import="java.util.*,com.zjut.an.admin.manager.*, com.zjut.an.admin.dao.*,com.zjut.an.role.dao.*, com.zjut.an.role.manager.*, com.zjut.an.util.system.*,com.zjut.an.util.tools.*" pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<%
if (session.getAttribute("admin") != null && request.getParameter("m")!=null) {
	AnRoleManager rmanager = (AnRoleManager) SpringContextUtil.getBean("AnRoleManager");
	String m = request.getParameter("m");
	AnAdmin admin = (AnAdmin)session.getAttribute("admin");
	AnRole role = rmanager.getData(admin.getRoId());
	if ((m.equals("adminpower") && Status.POWER_YES.getStatus().equals(role.getAdminpower())) 
		|| (m.equals("newspower") && Status.POWER_YES.getStatus().equals(role.getNewspower()))
		|| (m.equals("userpower") && Status.POWER_YES.getStatus().equals(role.getUserpower()))
		|| (m.equals("systempower") && Status.POWER_YES.getStatus().equals(role.getSystempower()))
		|| (m.equals("classpower") && Status.POWER_YES.getStatus().equals(role.getClasspower()))
		|| (m.equals("checkpower") && Status.POWER_YES.getStatus().equals(role.getCheckpower()))
		|| m.equals("oneself")) {
		//ok
	} else {
		out.print("<script>alert('禁止访问');</script>");
		out.print("<script>top.window.location='AdminLogin.html';</script>");
		out.close();
	    return;
	} 	
} else if(session.getAttribute("user") != null && request.getParameter("m")!=null) {
	String m = request.getParameter("m");
	if (m.equals("oneself")) {
			//ok
		} else {
			out.print("<script>alert('禁止访问');</script>");
			out.print("<script>top.window.location='AdminLogin.html';</script>");
			out.close();
		    return;
		} 	
} else {
	out.print("<script>top.window.location='AdminLogin.html';</script>");
	out.close();
    return;
}
%>
</head>
</html>